package com.jun.serviceimpl;

import com.jun.entity.User;
import com.jun.mapper.UserMapper;
import com.jun.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.Map;

@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;
    @Override
    public int insertUser(User user) {
        return userMapper.insertUser(user);
    }

    @Override
    public User getUserByTellPhone(String tellphone) {
        return userMapper.getUserByTellPhone(tellphone);
    }

    @Override
    public int updateUserByTellPhone(Map<String, Object> map) {
        return userMapper.updateUserByTellPhone(map);
    }

    @Override
    public int updateUserTimesByTellPhone(Map<String, Object> map) {
        return userMapper.updateUserTimesByTellPhone(map);
    }

    @Override
    public ArrayList<User> getAllUser() {
        return userMapper.getAllUser();
    }

    @Override
    public int updateUserTimeByTellPhone(Map<String, Object> map) {
        return userMapper.updateUserTimeByTellPhone(map);
    }

    @Override
    public int deleteUserByTellPhone(String tellphone) {
        return userMapper.deleteUserByTellPhone(tellphone);
    }

}
